////////////////////////////////////////////////////////////////////////////////
//  
//  Copyright (c) 2011 Gabriel Montagné Láscaris-Comneno and Alberto
//  Brealey-Guzmán.
//  
//  Permission is hereby granted, free of charge, to any person obtaining a
//  copy of this software and associated documentation files (the "Software"),
//  to deal in the Software without restriction, including without limitation
//  the rights to use, copy, modify, merge, publish, distribute, sublicense,
//  and/or sell copies of the Software, and to permit persons to whom the
//  Software is furnished to do so, subject to the following conditions:
//  
//  The above copyright notice and this permission notice shall be included in
//  all copies or substantial portions of the Software.
//  
//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
//  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
//  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
//  DEALINGS IN THE SOFTWARE.
//  
////////////////////////////////////////////////////////////////////////////////

package com.rojored.preloaders 
{

/**
 *  Defines the contract that a class must implement to be used as a staged
 *  preloader display.
 *
 *  <p>A staged preloader display will display the progress while downloading
 *  the Flex application and can be later reused to display the progress of
 *  the bootstrap or initialization stages. It exposes
 *  <code>stepProgressFrom</code> and <code>stepProgressTo</code> properties
 *  in order to configure the beginning and end percentages of the current
 *  step.</p>
 */
public interface IStagedPreloaderDisplay
{

    //--------------------------------------------------------------------------
    //
    //  Properties
    //
    //--------------------------------------------------------------------------

    /**
     *  Fraction from which the progress display for the particular stage
     *  starts.
     *
     *  <p>When used as a Flex application preloader this will tipically be 0.
     *  On later stages the property should be set to the value of the
     *  previous stage preloader <code>stepProgressTo</code> property.</p>
     */
    function get stepProgressFrom():Number; 
    function set stepProgressFrom(value:Number):void; 

    /**
     *  Fraction on which the progress display for the particular stage stops.
     *
     *  <p>When the <code>progress</code> property reaches 1.0, the staged
     *  preloader will draw progress up to <code>stepProgressTo</code>.</p>
     *
     *  <p>In a staged preloader/bootstrap process, the property should be set
     *  to the value of the next stage preloader <code>stepProgressFrom</code>
     *  property.</p>
     */
    function get stepProgressTo():Number; 
    function set stepProgressTo(value:Number):void; 

    /**
     *  Preload operation progress. Number from 0 to 1.0 that indicates the
     *  percentage done.
     */
    function get progress():Number;
    function set progress(value:Number):void;

    //--------------------------------------------------------------------------
    //
    //  Methods
    //
    //--------------------------------------------------------------------------

    /**
     *  Clears the progress indicator and stops updating it.
     */
    function clear():void; 

    /**
     *  Starts updating the progress indicator.
     */
    function startUpdates():void;

    /**
     *  Stops updating the progress indicator.
     */
    function stopUpdates():void;

}
}
